
{extend name="public/common"} {block name="body"}
<title>基本设置</title>
<link rel="stylesheet" type="text/css" href="__SYSMET__/lib/Hui-iconfont/1.0.8/iconfont.css" />
</head>
<style type="text/css">
	 .radius1:hover{
 	color: #fff;
	border-color: #66b1ff;
	background-color: #66b1ff;
 }
 span:hover{
 	color: #333;
 }
 .btn-primary1 {
    color: #fff;
    background-color: #5a98de;
    border-color: #5a98de;
    height: 31px;
    border-radius: 5px;
    font-size: 14px;
    line-height: 24px !important;
}
</style>
<body>
  <nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i>
    系统管理
    <span class="c-gray en">&gt;</span>
    运营管理
    <span class="c-gray en">&gt;</span>
    自助活动大厅
    <span class="c-gray en">&gt;</span>
   {if condition="$id eq 0"}添加{else/}修改{/if}自助活动
    <a class="btn btn-success radius r"
      style="line-height: 1.6em; margin-top: 3px"
      href="javascript:location.replace(location.href);" title="刷新">
      <i class="Hui-iconfont">&#xe68f;</i>
    </a>
  </nav>
  <article class="page-container">
  <form action="" method="post" enctype="application/x-www-form-urlencoded" class="form form-horizontal" id="form-article-add">
    <input type="hidden" value="{$id}" name="id">
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2" style="text-align: right">活动名称：</label>
      <div class="formControls col-xs-8 col-sm-9">
        
        <input required  name="hd_name" value="{if($detail)}{$detail['hd_name']}{/if}" style="width:205px;" class="input-text"  />
      </div>
    </div>

    <div class="row cl" style="margin-top:15px;">
      <label class="form-label col-xs-4 col-sm-2" style="text-align:right;">条件周期：</label>
      <label>
        &nbsp;&nbsp;&nbsp;<span>昨日</span>
        <input type="radio" {if(empty($detail)||1==$detail['tjzq'])} checked {/if}  name="tjzq" value="1"/>
      </label>
      <label>
        <span>上周</span>
        <input type="radio" {if($detail&&2==$detail['tjzq'])} checked {/if} name="tjzq"  value="2"/>
      </label>
      <label>
        <span>上月</span>
        <input type="radio" {if($detail&&3==$detail['tjzq'])} checked {/if} name="tjzq" value="3"/>
      </label>
    </div>

    <div id="huodong" style="height:auto;">
      {if(empty($hd_je))}
        <div style="overflow: hidden;width:100%;" class="lizi">
          <div class="row cl" style="float:left;width:33%;">
            <label class="form-label col-xs-6 col-sm-6" style="text-align: right">单次赠送金额：</label>
            <div class="formControls col-xs-6 col-sm-6">
              <input required name="hd_je" value="" style="width:160px;" class="input-text"  />
            </div>
          </div>
          <div class="row cl" style="float:left;width:33%;">
            <label class="form-label col-xs-6 col-sm-6" style="text-align: right">充值金额（条件）：</label>
            <div class="formControls col-xs-6 col-sm-6">
              <input required type="text" value="" style="width:160px;" name="tj_czje" class="input-text"/>
            </div>
          </div>
          <div class="row cl" style="float:left;width:33%;">
            <label class="form-label col-xs-6 col-sm-6" style="text-align: right">投注金额（条件）：</label>
            <div class="formControls col-xs-6 col-sm-6">
              <input required type="text" value="" style="width:160px;" name="tj_tzje" class="input-text" />
            </div>
          </div>
          <i class="Hui-iconfont delete_acive" onclick="removeLi(this)" style="display:block;float:left;font-size:19px;margin-top:15px;margin-left:30px;">&#xe60b;</i>
        </div>
      {else/}
      {volist name="hd_je" id="v"}
      <div style="overflow: hidden;width:100%;" class="lizi">
        <div class="row cl" style="float:left;width:33%;">
          <label class="form-label col-xs-6 col-sm-6" style="text-align: right">单次赠送金额：</label>
          <div class="formControls col-xs-6 col-sm-6">
            <input required name="hd_je{$key}" value="{$v}" style="width:160px;" class="input-text"  />
          </div>
        </div>
        <div class="row cl" style="float:left;width:33%;">
          <label class="form-label col-xs-6 col-sm-6" style="text-align: right">充值金额（条件）：</label>
          <div class="formControls col-xs-6 col-sm-6">
            <input required type="text" value="{$tj_czje[$key]}" style="width:160px;" name="tj_czje{$key}" class="input-text"/>
          </div>
        </div>
        <div class="row cl" style="float:left;width:33%;">
          <label class="form-label col-xs-6 col-sm-6" style="text-align: right">投注金额（条件）：</label>
          <div class="formControls col-xs-6 col-sm-6">
            <input required type="text" value="{$tj_tzje[$key]}" style="width:160px;" name="tj_tzje{$key}" class="input-text" />
          </div>
        </div>
        <i class="Hui-iconfont delete_acive" onclick="removeLi(this)" style="display:block;float:left;font-size:19px;margin-top:15px;margin-left:30px;">&#xe60b;</i>
      </div>
      {/volist}
      {/if}
    </div>
   <div class="row">
      <label  style="text-align: center;border:1px solid #ccc;width:100px;margin-left:10%;" id="add_gd">添加条件</label>
    </div>
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2" style="text-align: right">单人领取次数：</label>
      <div class="formControls col-xs-8 col-sm-9">
        <input type="text" required style="width:50%;" name="lq_count" class="input-text" value="{if($detail)}{$detail['lq_count']}{/if}" / >
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2" style="text-align: right">发放总次数：</label>
      <div class="formControls col-xs-8 col-sm-9">
        <input type="text" required style="width:50%;" name="lq_zcount" class="input-text" value="{if($detail)}{$detail['lq_zcount']}{/if}"  / >
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2" style="text-align: right">发布时间：</label>
      <div class="formControls col-xs-8 col-sm-9">
        <input required onfocus="WdatePicker({maxDate:'%y-%M-%d'})" type="text" style="width:50%;" name="fatime" value="{$time}" class="input-text" / >
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2" style="text-align: right">自助活动说明文字：</label>
      <div class="formControls col-xs-8 col-sm-9">
        <textarea name="smwz" style="width:50%; margin-top:15px; font-size:13px" rows="3">{if($detail)}{$detail['smwz']}{/if}</textarea>
      </div>
    </div>
    
    
    <div class="am-margin" style="margin-top:60px;">
  		<input type="submit" name="submit" style="margin-left:170px;" class="btn btn-danger radius"  value="提交保存" />
   		<input type="button" onclick="javascript:history.go(-1);" style="margin-left:30px;" class="btn btn-primary radius radius1 btn-primary1"  value="关闭" />
  </div>
    
  </form>
  </article>
  <div class="am-btn-group" data-am-button>
       （<font style="font-size:12px; color:#990000">注：总次数为周期内次数，例如：总次数为10次，周期为昨日那么就是今天领取总次数为10次明天也是10次</font>）
    </div>      

  <script type="text/javascript" src="__SYSMET__/lib/My97DatePicker/4.8/WdatePicker.js"></script>

  <script>
  	var a= parseInt('{$order}');
  	$('#add_gd').click(function(){
  		 var  html=' <div style="overflow: hidden;width:100%;" class="lizi">'
	    	 html+=' <div class="row cl" style="float:left;width:33%;">'
		     html+=' <label class="form-label col-xs-6 col-sm-6" style="text-align: right">单次赠送金额：</label>'
		    html +=' <div class="formControls col-xs-6 col-sm-6">'
		        
		      html +=' <input required name="hd_je'+a+'" value="" style="width:160px;" class="input-text"  /> </div></div>'
		   html+=' <div class="row cl" style="float:left;width:33%;">'
		   html +='  <label class="form-label col-xs-6 col-sm-6" style="text-align: right">充值金额（条件）：</label>'
		   html +='  <div class="formControls col-xs-6 col-sm-6">'
		    html  +='  <input required type="text" style="width:160px;" name="tj_czje'+a+'" class="input-text" / > </div></div>'
		  
		  
		   html+=' <div class="row cl" style="float:left;width:33%;">'
		  html  +='  <label class="form-label col-xs-6 col-sm-6" style="text-align: right">投注金额（条件）：</label>'
		   html +='  <div class="formControls col-xs-6 col-sm-6">'
		    html  +='  <input required type="text" style="width:160px;" name="tj_tzje'+a+'"   class="input-text" / >'
		    html +=' </div></div><i class="Hui-iconfont delete_acive" onclick="removeLi(this)" style="display:block;float:left;font-size:19px;margin-top:15px;margin-left:30px;" class="">&#xe60b;</i></div>'
  		 $('#huodong').append(html);
        a++;
  	});
    function removeLi(obj){
      $(obj).parents('.lizi').remove();
    }
  </script>
{/block} 

